<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>轨迹线</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    let TrailRepeatLineArray = [];
    window.app = new GE.App('mapContainer', {
        position: [120.170646, 30.28362, 2000], //相机的位置
        lookAt: [120.170646, 30.28362, 0], //相机看向的地图位置
        cameraScrollSpeed: 5,
        minZoom: 1,
        maxZoom: 18,
        ambientLightIntensity: 5,
        useDefaultTexture: true, //是否使用瓦片默认纹理
        fogColor: '#66CCFF', //雾的颜色
        fogStartAngle: 40, //雾开始的角度
        // background: "Sky",
        isUseMapCarpet: true, //是否开启地图的地毯底图，避免地图拖动的时候没来得及加载的瓦片一片空白
        baseLayer: [
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', //影像底图的url
                urlDecimal: true, //影像底图url中的瓦片行列号是否是十进制，true表示十进制，false表示十六进制
                tileType: 'image',
                isSelect: true, //是否可以被选中
            },
        ]
    });


    TrailRepeatLine();   
    function TrailRepeatLine() {
        let pathArray = [ 
            new GE.Point(13376713.90129997, 3540579.2959903134, 0, '3857'),
            new GE.Point(13376711.98134067, 3539826.5375406537, 0, '3857'),
            new GE.Point(13377952.49603797, 3539759.3270052206, 0, '3857'),
            new GE.Point(13378008.185227688, 3540675.3111583497, 0, '3857'),
            new GE.Point(13377184.375437068, 3540339.2581293588, 0, '3857'),
            new GE.Point(13376713.90129997, 3540579.2959903134, 0, '3857'),
        ];

        for(var i=0;i<pathArray.length-1;i++)
        {
                let points = [pathArray[i],pathArray[i+1]];
                let TrailRepeatLine = new GE.TrailRepeatLine({            
                points:points,
                linewidth: 50,
                time: 2000, 
                texture: 'http://192.168.2.100:8701/dev/examples/resources/images/right_arrow.png',
            })
            TrailRepeatLineArray.push(TrailRepeatLine);
            app.add(TrailRepeatLine);
        }
        window.effect = TrailRepeatLine;
    }


</script>

</html>